package com.mdd.common.enums;

import com.google.common.collect.Maps;

import java.util.Map;

/**
 * @ClassName RegionLevelEnum
 * @Description
 * @Autore Slien.zuo
 * @Date 2022/10/7 14:45
 * @Version 1.0
 **/
public enum RegionLevelEnum {

    COUNTRY(0, "国家"),
    PROVINCE(1, "省"),
    CITY(2, "市"),
    DISTRICT(3, "区");

    private final int code;
    private final String desc;

    RegionLevelEnum(int code, String desc) {
        this.code = code;
        this.desc = desc;
    }

    /**
     * 获取状态码
     *
     * @return Long
     * @author fzr
     */
    public int getCode() {
        return this.code;
    }

    /**
     * 获取提示
     *
     * @return String
     * @author fzr
     */
    public String getDesc() {
        return this.desc;
    }

    public static Map<Integer, String> getMap() {
        Map<Integer, String> map = Maps.newHashMap();
        for (RegionLevelEnum codeEnum : RegionLevelEnum.values()) {
            map.put(codeEnum.code, codeEnum.desc);
        }
        return map;
    }
}
